#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int count = 0;
    for (int i = 2; i <= 2020; i++)
    {
        int a = i;
        while (a > 0)
        {
            if (a % 10 == 2)
                count++;
            a /= 10;
        }
    }
    printf("%d", count);
    return 0;
}

